/**
 * 
 */
package com.door.erp.controller;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import com.door.erp.model.SellOrder;
import com.door.erp.pager.Pager;
import com.door.erp.sevice.SellOrderService;

/**
 * @author lenovo
 *
 */
@Controller
@RequestMapping(value = "/sellOrder")
public class SellOrderController {
	@Resource(name="sellOrderService", type=SellOrderService.class)
	private SellOrderService sellOrderService;
	@RequestMapping(value = "/add")
	public ModelAndView add() {
		ModelAndView mv = new ModelAndView("index/index");
	//	mv.addObject("stock", StockManager.pop());
		return mv;
	}
	@RequestMapping(value = "/update")
	public ModelAndView update() {
		ModelAndView mv = new ModelAndView("index/index");
	//	mv.addObject("stock", StockManager.pop());
		return mv;
	}
	@RequestMapping(value = "/delete")
	public ModelAndView delete() {
		ModelAndView mv = new ModelAndView("index/index");
	//	mv.addObject("stock", StockManager.pop());
		return mv;
	}
	@RequestMapping(value = "/find/{id}")
	public ModelAndView find(String id) {
		ModelAndView mv = new ModelAndView("index/index");
	//	mv.addObject("stock", StockManager.pop());
		return mv;
	}
	@RequestMapping(value = "index.do")
	public ModelAndView index(Pager pager) {
		ModelAndView mv = new ModelAndView("product/productIndex");
		Map<String,Object> params=new HashMap<String,Object>();
		List<SellOrder> sellOrders =sellOrderService.getAll(pager);
		mv.addObject("sellOrders", sellOrders);
		mv.addObject("pager", pager);
		return mv;
	}
}
